package com.whiteape.book.ui.activity;

import android.didikee.donate.AlipayDonate;
import android.didikee.donate.WeiXinDonate;
import android.graphics.BitmapFactory;
import android.os.Environment;

import com.whiteape.book.R;
import com.whiteape.book.ui.base.BaseActivity;

import java.io.File;
import java.io.InputStream;

public class DonateActivity extends BaseActivity {

    //alipay   fkx092556rbscz1p58gb9ef

    private void donateAlipay(String payCode) {
        boolean hasInstalledAlipayClient = AlipayDonate.hasInstalledAlipayClient(this);
        if (hasInstalledAlipayClient) {
            AlipayDonate.startAlipayClient(this, payCode);
        }
    }

    /**
     * 需要提前准备好 微信收款码 照片，可通过微信客户端生成
     */
//    private void donateWeixin() {
//        InputStream weixinQrIs = getResources().openRawResource(R.raw.didikee_weixin);
//        String qrPath = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "AndroidDonateSample" + File.separator +
//                "didikee_weixin.png";
//        WeiXinDonate.saveDonateQrImage2SDCard(qrPath, BitmapFactory.decodeStream(weixinQrIs));
//        WeiXinDonate.donateViaWeiXin(this, qrPath);
//    }

    @Override
    protected int getContentId() {
        return R.layout.activity_donate;
    }
}
